package com.alibaba.citrus.cr.sales.plan.api.salesplan.report;

import com.alibaba.citrus.cr.sales.plan.dto.api.request.SalesPlanReportPageQueryRequest;
import com.alibaba.citrus.cr.sales.plan.dto.api.request.SalesPlanReportQueryRequest;
import com.alibaba.citrus.cr.sales.plan.dto.api.request.SalesPlanReportRequest;
import com.alibaba.citrus.cr.sales.plan.dto.api.response.SalesPlanAuditRecordResponse;
import com.alibaba.citrus.cr.sales.plan.sdo.SalesPlanReportSDO;
import com.alibaba.cz.base.tool.page.PageResult;
import com.alibaba.lattice2.epoch.meshflow.model.annotation.MeshFlowService;
import com.alibaba.lattice2.epoch.sdk.model.Result;

import java.util.List;
import java.util.Map;

@MeshFlowService(apps = {"bc_order"}, name = "salesPlanReportQueryService")
public interface SalesPlanReportQueryService {

    /**
     * 查询提报单列表
     * @param request
     * @return
     */
    Result<PageResult<List<SalesPlanReportSDO>>> pageQuerySalesPlanReport(SalesPlanReportPageQueryRequest request);

    /**
     * 查询提报单详情
     * @param request
     * @return
     */
    Result<SalesPlanReportSDO> querySalesPlanReport(SalesPlanReportQueryRequest request);

    /**
     * 查询前序提报单集审批状态
     * 前序提报单是否都审批通过
     * @param request
     * @return
     */
    Result<Boolean> queryPreSalesPlanReportAuditStatus(SalesPlanReportRequest request);

    /**
     * 查询提报单对应的审批记录
     * @param request
     * @return
     */
    Result<List<SalesPlanAuditRecordResponse>> querySalesPlanAuditRecordList(SalesPlanReportRequest request);

    /**
     * 查询当前操作人对应的提报单是否有审批权限
     * @param request
     * @return
      */
    Result<Boolean> verifyAuditPermission(SalesPlanReportRequest request);

    /**
     * 批量验证审批权限
     * Map<String, Boolean>  key是提报单id，value是是否有审核权限
     * @param request
     * @return
     */
    Result<Map<String, Boolean>> batchVerifyAuditPermission(SalesPlanReportRequest request);

    /**
     * 查询月度计划对应的审批记录
     * @param request
     * @return
     */
    Result<List<SalesPlanAuditRecordResponse>> querySalesPlanAuditRecordListV2(SalesPlanReportPageQueryRequest request);

    /**
     * 查询当前操作人对应的提报单是否有撤回权限
     * @param request
     * @return
     */
    Result<Boolean> verifyRevokePermission(SalesPlanReportRequest request);
}
